package com.ysd.Dao.Impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import com.ysd.entity.Company;
import com.ysd.entity.Img;
import com.ysd.entity.Img;
import com.ysd.util.DBmanager;

public class ImgDaoImpl {
	

	public Img getImg() {

		Connection conn = DBmanager.getConnection();
		Statement st = null;
		ResultSet rs = null;
		Img img = null;
		try {
			st = conn.createStatement();
			rs = st.executeQuery("select * from img");
			while(rs.next()) {
				String  imgPath1 = rs.getString("imgPath1");
				String  imgPath2 = rs.getString("imgPath2");
				String  imgPath3 = rs.getString("imgPath3");
				String  imgPath4 = rs.getString("imgPath4");
				String sheJiYuYan = rs.getString("sheJiYuYan");  
				String culturePicture = rs.getString("culturePicture");  
				String introducePicture = rs.getString("introducePicture");  
				String introduceBigPricture = rs.getString("introduceBigPricture");  
				img = new Img(imgPath1,imgPath2,imgPath3,imgPath4,sheJiYuYan,culturePicture,introducePicture,introduceBigPricture);
					
			}
			return img;
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}finally {
			DBmanager.closeAll(conn, st, rs);
		}
	}
}
